Skip to content

Conversation

@JLambertazzo
Copy link

@JLambertazzo JLambertazzo commented Aug 31, 2025

Batch insert would be very useful to us as we use Vectra to prototype RAG solutions and tend to load in a large amount of data at once.

Setup tests using node:assert to avoid modifying dependencies. Provided test cases pass
Screenshot 2025-08-31 170022

Also fixed a bug where the items array on _data was being passed by reference in the call to Object.assign. This was causing the third test case to fail because any mutation of this._update.items was also mutating this._data.items (see debug repl below).
Screenshot 2025-08-31 165722

Originally `Object.assign` was being used to create a copy of the object.
I replaced it in a previous commit with `structuredClone` since the copy
was not a deep one.

I keps the `Object.assign` call in case the other functionality it offers
was relevant, but seeing as `_update` is checked to be `undefined`, there
are no properties to keep in the call to assign.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant